package tv.youxing.android.ui;

import android.app.Activity;
import android.os.Bundle;

import com.kymjs.rxvolley.RxVolley;
import com.kymjs.rxvolley.client.HttpCallback;
import com.kymjs.rxvolley.client.HttpParams;
import com.kymjs.rxvolley.http.VolleyError;

import tv.youxing.android.R;
import tv.youxing.android.utils.L;
import tv.youxing.android.utils.StaticClass;

public class UpdatePasswordActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_update_password);


        //post请求简洁版实现
        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIyLCJpc3MiOiJodHRwOi8veXgudGhlc2Vzb2Z0LmNvbS9hcGkvdXNlci9sb2dpbiIsImlhdCI6MTQ5NzUxOTg0NywiZXhwIjoxNTAwMTExODQ3LCJuYmYiOjE0OTc1MTk4NDcsImp0aSI6InhqeFg1WlZKcVpBbGFaR3UifQ.Np4NYoNQy_5xXcNNC0TrtCqouQ2I2sQYvoXv0rIoSgQ";
        HttpParams params = new HttpParams();
        params.putHeaders("Authorization","Bearer "+token);
//        params.put("Bearer ",token);
        params.put("password", "testdemo123");
        params.put("new_password", "testdemo321");

        RxVolley.post(StaticClass.modifyPwdURL, params, new HttpCallback() {
            @Override
            public void onSuccess(String t) {
                L.d("onSuccess:"+t);
            }

            @Override
            public void onFailure(VolleyError error) {

                L.d("onFailure:"+error.getMessage());
            }
        });
    }
}
